package com.animal.service.impl;


import com.animal.entity.pojo.APet;
import com.animal.mapper.PetMapper;
import com.animal.service.PetService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PetServiceImpl implements PetService {
    @Autowired
    private PetMapper petMapper;
    @Override
    public List getAllPet(String petName ,String petType,Integer status) {
        return petMapper.getAllPet(petName,petType,status);
    }

    @Override
    public APet getPetById(Integer id) {
        return petMapper.getPetById(id);
    }

    @Override
    public int add(APet aPet) {
        return petMapper.add(aPet);
    }


    @Override
    public int delByIds(List<Integer> ids) {
        return petMapper.delByIds(ids);
    }

    @Override
    public boolean deleteById(Integer id) {
        int count = petMapper.deleteById(id);
        if(count>0){
            return true;
        }else {
            return false;
        }

    }

    @Override
    public int update(APet aPet) {
        return petMapper.update(aPet);
    }
}
